using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;


namespace MessageLibrary
{
    /// <summary>
    /// a base class for the chat message that will be sent
    /// by both clients and server
    /// </summary>
    [Serializable]        
    public abstract class AbsMessage
    {
        ///a base delegate for invoking control from
        ///the message HanleMesgae method
        public delegate void MessageInvoker(RichTextBox rtfBox, Client c);
        //the time the messgae was created
        protected DateTime time;        
        protected string username = string.Empty;
        
        public AbsMessage(string name)
        {
            username = name;
            time = DateTime.Now;
        }
        /// <summary>
        /// Handles the message with the appropriate
        /// contrls of the running programm
        /// </summary>
        /// <param name="textBox">a rich text box that will updated</param>
        /// <param name="c">the sending client</param>
        public abstract void HandleMessage(RichTextBox textBox,Client c);
        
    }
}
